<?php
ini_set("display_errors","on");
//carga todas las clases
require_once("classes/XForms.php");
function adir($path){
  $res = "";
  foreach(glob($path.'/*.php') as $f) {
    $res.=$f."<br />";
    require_once($f);
  }
  foreach(glob($path.'/*', GLOB_ONLYDIR) as $f) {
    $subres=adir($f);
    if($subres) {
      $res.=$subres;
    }
  }
  return $res;
}
echo adir("classes");
$cla = get_declared_classes();
foreach($cla as $i=>$c){
  if($c=="XForms") break;
  unset($cla[$i]);
}
foreach($cla as $c){
  echo 
<<<EOF

        <UML:Class 
          name = '{$c}' visibility = 'public' isSpecification = 'false' isRoot = 'false'
          isLeaf = 'false' isAbstract = 'false' isActive = 'false'>
          <UML:Classifier.feature>
EOF;
foreach(get_class_methods($c) as $m) {
$rm = new ReflectionMethod($c, $m);
  echo 
<<<EOF

            <UML:Operation 
              name = '{$m}' visibility = 'public' isSpecification = 'false' ownerScope = 'instance'
              isQuery = 'false' concurrency = 'sequential' isRoot = 'false' isLeaf = 'false'
              isAbstract = 'false'>
              <UML:BehavioralFeature.parameter>
EOF;
foreach($rm->getParameters() as $p){
  echo 
<<<EOF

                <UML:Parameter 
                  name = '{$p->name}' isSpecification = 'false' kind = 'in'>
                </UML:Parameter>
EOF;
}
  echo 
<<<EOF

              </UML:BehavioralFeature.parameter>
            </UML:Operation>
EOF;
}
  echo 
<<<EOF

          </UML:Classifier.feature>
        </UML:Class>
EOF;
}
